import java.util.*;

abstract class Employee{
    abstract public int getSalary();
}

class Manager extends Employee{
    int salary;

    Manager(int salary){
        this.salary = salary;
    }
    public int getSalary() {
        return salary;
    }
}
class Salesman extends Employee{
    int salary;
    int commission;

    Salesman(int salary,int commission){
        this.salary = salary;
        this.commission = commission;
    }
    public int getSalary() {
        return salary+commission;
    }
}
class Worker extends Employee{
    int salary;
    int day;

    Worker(int salary,int day){
        this.salary = salary;
        this.day = day;
    }
    public int getSalary() {
        return salary*day;
    }
}

public class Main5{
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int managerSalary = scan.nextInt();
        int salemanSalary = scan.nextInt();
        int salemanRaise = scan.nextInt();
        int workerEveryday = scan.nextInt();
        int workerDays = scan.nextInt();

        Employee e1 = new Manager(managerSalary);
        Employee e2 = new Salesman(salemanSalary, salemanRaise);
        Employee e3 = new Worker(workerEveryday, workerDays);

        System.out.println(e1.getSalary());
        System.out.println(e2.getSalary());
        System.out.println(e3.getSalary());

        scan.close();


    }
}

